//
//  SerializeThread.m
//  Test
//
//  Created by lizq on 16/6/1.
//  Copyright © 2016年 lizq. All rights reserved.
//

#import "SerializeThread.h"

@implementation SerializeThread
- (void)runSerialize {
  
    dispatch_queue_t queue1 = dispatch_queue_create("queue1", NULL);
    dispatch_queue_t queue2 = dispatch_queue_create("queue2", NULL);
    dispatch_async(queue1, ^{
       //queue1执行
        dispatch_async(queue2, ^{
            for(NSInteger i =0;i< 1000000;i++) {
                NSLog(@"");
            }
            NSLog(@"执行1");
        });
    });
    dispatch_async(queue1, ^{
        //queue2执行
        NSLog(@"执行2");
    });
    
    dispatch_after(10, queue1, ^{
        NSLog(@"after queue1 end !");
    });
}
@end
